<template>
    <div class="tab-bar">
        <van-tabbar route active-color="#ee0a24" v-if="$route.meta.showTabBar">
            <van-tabbar-item icon="home-o" replace to="/home">首页</van-tabbar-item>
            <van-tabbar-item icon="list-switching" replace to="/category">分类</van-tabbar-item>
            <van-tabbar-item icon="cart-o" replace to="/cart">购物车</van-tabbar-item>
            <van-tabbar-item icon="manager-o" replace to="/mine">我的</van-tabbar-item>
        </van-tabbar>
    </div>
</template>

<script>
import { ref } from 'vue';
import { showToast } from 'vant';

export default {
    name: 'TabBar',
    data() {
        return {
            // active: 0,
        }
    },
    setup() {
        const active = ref(0);
        // const onChange = (index) => showToast(`标签 ${index}`);
        return {
            active,
            // onChange
        };
    },
}
</script>

<style scoped>
.tab-bar{
    height: 50px;
}
</style>
